//
//  UIView+frame.m
//  百思不得解
//
//  Created by 王玉东 on 16/3/22.
//  Copyright © 2016年 wyd. All rights reserved.
//

#import "UIView+frame.h"

@implementation UIView (frame)

-(CGSize)size{
    return self.frame.size;
}
-(void)setSize:(CGSize)size{

    CGRect frame = self.frame;
    
    frame.size = size;
    
    self.frame = frame;
}

-(void)setX:(CGFloat)X{

    CGRect frame = self.frame;
    
    frame.origin.x = X;
    
    self.frame = frame;
}
-(void)setY:(CGFloat)Y{
    
    CGRect frame = self.frame;
    
    frame.origin.y = Y;
    
    self.frame = frame;
}
-(void)setW:(CGFloat)W{
    
    CGRect frame = self.frame;
    
    frame.size.width = W;
    
    self.frame = frame;
}
-(void)setH:(CGFloat)H{
    
    CGRect frame = self.frame;
    
    frame.size.height = H;
    
    self.frame = frame;
}

-(CGFloat)H{
    return self.frame.size.height;
}
-(CGFloat)W{

    return self.frame.size.width;
    
}
-(CGFloat)X{

    return self.frame.origin.x;
    
}

-(CGFloat)Y{

    return self.frame.origin.y;

}
@end
